<!DOCTYPE html>
<html>
{include file='/common/_meta'}
<body>
	<!-- 头部 -->
{include file='/common/top'}
	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			            <!-- Page Sidebar -->
        {include file='/common/left'}
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <a href="{:url('Index/index')}">系统</a>
                        </li>
                                            <li>
                            <a href="{:url('config/lst')}">配置管理</a>
                        </li>
                        <li class="active">配置项</li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-header bordered-bottom bordered-blue">
                <span class="widget-caption">配置项</span>
            </div>
            <!-- 配置列表开始 -->
            <div class="widget-body">

                <div class="docs-example">
                    <ul class="nav nav-tabs tabs-flat">
                        <li class="active"><a href="#info-tab" data-toggle="tab" aria-expanded="false">店铺配置</a></li>
                        <li class=""><a href="#address-tab" data-toggle="tab" aria-expanded="true">商品配置</a></li>
                    </ul>

                    <form id="accountForm" method="post" class="form-horizontal bv-form" enctype="multipart/form-data">
                        <button type="submit" class="bv-hidden-submit" style="display: none; width: 0px; height: 0px;">
                        </button>
                        <div class="tab-content tabs-flat">
                            <div class="tab-pane active" id="info-tab">
                                <?php foreach ($shopconflist as $k => $confs): ?>


                                    <div class="form-group">
                                        <label for="username" class="col-sm-2 control-label no-padding-right"><?php echo $confs['config_cname']; ?></label>
                                        <div class="col-sm-6">
                                            <?php if ($confs['config_formtype'] == 'input'): ?>
                                                <!-- 单行文本 -->
                                            <input class="form-control" id="username" placeholder="" value="<?php echo $confs['config_default']; ?>" name="<?php echo $confs['config_ename'];?>" type="text">
                                            <?php elseif ($confs['config_formtype'] == 'radio'): ?>
                                                <!-- 单选项 -->
                                            <div class="radio">
                                                <?php if($confs['config_values']):
                                                    $arr = explode(',' , $confs['config_values']);
                                                    foreach( $arr as $k1 => $v1 ):
                                                ?>
                                                <label style="padding-right: 10px;">
                                                    <input class="inverted colored-blue" id="username" value="<?php echo $v1;?>" name="<?php echo $confs['config_ename'];?>" type="radio"  <?php if($confs['config_default'] == $v1){echo 'checked="checked"';}?> >
                                                    <span class="text"><?php echo $v1; ?></span>
                                                </label>
                                                <?php endforeach; endif; ?>
                                            </div>
                                            <?php elseif ($confs['config_formtype'] == 'checked'): ?>
                                                <!-- 复选框-->
                                            <div class="checkbox">
                                                <?php if($confs['config_values']):
                                                    $arr_val = explode(',' , $confs['config_values']);
                                                    $arr_def = explode(',' , $confs['config_default']);
                                                    foreach( $arr_val as $k3 => $v3):
                                                ?>
                                                <label style="padding-right: 10px;">
                                                    <input class="form-control colored-blue" id="username" name="<?php echo $confs['config_ename'];?>[]" type="checkbox" <?php if(in_array($v3,$arr_def)){ echo 'checked="checked"';}?> value="<?php echo $v3;?>" >
                                                    <span class="text"><?php echo $v3; ?></span>
                                                </label>
                                                <?php endforeach;endif;?>
                                            </div>

                                            <?php elseif ($confs['config_formtype'] == 'textarea'): ?>
                                                <!-- 文本框 -->
                                            <textarea class="form-control" id="username" name="<?php echo $confs['config_ename'];?>" ><?php echo $confs['config_default']; ?></textarea>

                                            <?php elseif ($confs['config_formtype'] == 'select'): ?>
                                                <!-- 下拉式 -->
                                            <select class="form-control" id="username" name="<?php echo $confs['config_ename'];?>" type="radio">
                                }
<!--                                                 <option value="">请选择</option>
 -->                                                <?php if($confs['config_values']):
                                                    $arr = explode(',' , $confs['config_values']);
                                                    foreach ( $arr as $k2 => $v2 ):
                                                ?>
                                                <option <?php if($confs['config_default'] == $v2){echo 'selected="selected"';}?> value="<?php echo $v2; ?>"><?php echo $v2;?></option>
                                                <?php endforeach; endif; ?>
                                            </select>

                                            <?php elseif ($confs['config_formtype'] == 'file'): ?>
                                                <!-- 文件 -->
                                            <input id="username" name="<?php echo $confs['config_ename'];?>" type="file">

                                                <?php if($confs['config_default']): ?>
                                                    <img src="__upload__/{$confs.config_default}" alt="" height="40">
                                                <?php else: ?>
                                                    <p style="line-height: 40px">暂无图片</p>
                                                <?php endif; ?>

                                            <?php endif; ?>

                                        </div>
                                    </div>


                                <?php endforeach; ?>

                            </div>
                            <div class="tab-pane" id="address-tab">
                                <?php foreach ($commconflist as $k => $confs): ?>


                                    <div class="form-group">
                                        <label for="username" class="col-sm-2 control-label no-padding-right"><?php echo $confs['config_cname']; ?></label>
                                        <div class="col-sm-6">
                                            <?php if ($confs['config_formtype'] == 'input'): ?>
                                                <!-- 单行文本 -->
                                            <input class="form-control" id="username" placeholder="" value="<?php echo $confs['config_default']; ?>" name="<?php echo $confs['config_ename'];?>" type="text">
                                            <?php elseif ($confs['config_formtype'] == 'radio'): ?>
                                                <!-- 单选项 -->
                                            <div class="radio">
                                                <?php if($confs['config_values']):
                                                    $arr = explode(',' , $confs['config_values']);
                                                    foreach( $arr as $k1 => $v1 ):
                                                ?>
                                                <label style="padding-right: 10px;">
                                                    <input class="inverted colored-blue" id="username" value="<?php echo $v1;?>" name="<?php echo $confs['config_ename'];?>" type="radio"  <?php if($confs['config_default'] == $v1){echo 'checked="checked"';}?> >
                                                    <span class="text"><?php echo $v1; ?></span>
                                                </label>
                                                <?php endforeach; endif; ?>
                                            </div>
                                            <?php elseif ($confs['config_formtype'] == 'checked'): ?>
                                                <!-- 复选框-->
                                            <div class="checkbox">
                                                <?php if($confs['config_values']):
                                                    $arr_val = explode(',' , $confs['config_values']);
                                                    $arr_def = explode(',' , $confs['config_default']);
                                                    foreach( $arr_val as $k3 => $v3):
                                                ?>
                                                <label style="padding-right: 10px;">
                                                    <input class="form-control colored-blue" id="username" name="<?php echo $confs['config_ename'];?>[]" type="checkbox" <?php if(in_array($v3,$arr_def)){ echo 'checked="checked"';}?> value="<?php echo $v3;?>" >
                                                    <span class="text"><?php echo $v3; ?></span>
                                                </label>
                                                <?php endforeach;endif;?>
                                            </div>

                                            <?php elseif ($confs['config_formtype'] == 'textarea'): ?>
                                                <!-- 文本框 -->
                                            <textarea class="form-control" id="username" name="<?php echo $confs['config_ename'];?>" ><?php echo $confs['config_default']; ?></textarea>

                                            <?php elseif ($confs['config_formtype'] == 'select'): ?>
                                                <!-- 下拉式 -->
                                            <select class="form-control" id="username" name="<?php echo $confs['config_ename'];?>" type="radio">
<!--                                                 <option value="">请选择</option>
 -->                                                <?php if($confs['config_values']):
                                                    $arr = explode(',' , $confs['config_values']);
                                                    foreach ( $arr as $k2 => $v2 ):
                                                ?>
                                                <option <?php if($confs['config_default'] == $v2){echo 'selected="selected"';}?> value="<?php echo $v2; ?>"><?php echo $v2;?></option>
                                                <?php endforeach; endif; ?>
                                            </select>

                                            <?php elseif ($confs['config_formtype'] == 'file'): ?>
                                                <!-- 文件 -->
                                            <input id="username" name="<?php echo $confs['config_ename'];?>" type="file">

                                                <?php if($confs['config_default']): ?>
                                                    <img src="__upload__/{$confs.config_default}" alt="" height="40">
                                                <?php else: ?>
                                                    <p style="line-height: 40px">暂无图片</p>
                                                <?php endif; ?>

                                            <?php endif; ?>

                                        </div>
                                    </div>


                                <?php endforeach; ?>

                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-8 col-lg-offset-4">
                                <button type="submit" class="btn btn-blue">提交配置</button>
                            </div>
                        </div>
                    </form>
                </div>
                    

            </div>
        </div>
    </div>
</div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

	    <!--Basic Scripts-->
    {include file='/common/footer'}
    

</body></html>